Rules for integrands involving gamma functions

1.  ∫u Gamma[n,a+b x]dx

1:  ∫Gamma[n,a+b x]dx

Derivation: Integration by parts

Basis: (∂_x)Gamma[n,a+b x]==-((b (((a+b x))^(n-1)))/(e^(a+b x)))

Rule:

∫Gamma[n,a+b x]dx  ⟶  (((a+b x) Gamma[n,a+b x])/b)+∫((((a+b x))^n)/(e^(a+b x)))dx   ⟶  (((a+b x) Gamma[n,a+b x])/b)-((Gamma[n+1,a+b x])/b)

Program code:

Int[Gamma[n_,a_.+b_.*x_],x_Symbol] :=
  (a+b*x)*Gamma[n,a+b*x]/b - Gamma[n+1,a+b*x]/b /;
FreeQ[{a,b,n},x]

2.  ∫(((d x))^m) Gamma[n,b x]dx

1.  ∫((Gamma[n,b x])/x)dx

1.  ∫((Gamma[n,b x])/x)dx  when  n∈ℤ

1:  ∫((Gamma[0,b x])/x)dx

Basis: Gamma[0,z]==ExpIntegralE[1,z]

Rule:

∫((Gamma[0,b x])/x)dx  ⟶  ∫((ExpIntegralE[1,b x])/x)dx
  ⟶  b x HypergeometricPFQ[{1,1,1},{2,2,2},-b x]-EulerGamma Log[x]-(1/2) ((Log[b x])^2)

Program code:

Int[Gamma[0,b_.*x_]/x_,x_Symbol] :=
  b*x*HypergeometricPFQ[{1,1,1},{2,2,2},-b*x] - EulerGamma*Log[x] - 1/2*Log[b*x]^2 /;
FreeQ[b,x]

x:  ∫((Gamma[1,b x])/x)dx

Derivation: Algebraic expansion

Basis: Gamma[1,z]==(1/(e^z))

Note: Mathematica automatically evaluates Gamma[1,z] to (e^(-z)).

Rule: If  n>1, then

∫((Gamma[1,b x])/x)dx  ⟶  ∫(1/(x (e^(b x))))dx

Program code:

(* Int[Gamma[1,b_.*x_]/x_,x_Symbol] :=
  Int[1/(x*E^(b*x)),x] /;
FreeQ[b,x] *)

2:  ∫((Gamma[n,b x])/x)dx  when  n-1∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: Gamma[n,z]==((z^(n-1))/(e^z))+(n-1) Gamma[n-1,z]

Rule: If  n-1∈(SuperPlus[ℤ]), then

∫((Gamma[n,b x])/x)dx  ⟶  b ∫((((b x))^(n-2))/(e^(b x)))dx+(n-1) ∫((Gamma[n-1,b x])/x)dx  ⟶  -Gamma[n-1,b x]+(n-1) ∫((Gamma[n-1,b x])/x)dx

Program code:

Int[Gamma[n_,b_.*x_]/x_,x_Symbol] :=
  -Gamma[n-1,b*x] + (n-1)*Int[Gamma[n-1,b*x]/x,x] /;
FreeQ[b,x] && IGtQ[n,1]

3:  ∫((Gamma[n,b x])/x)dx  when  n∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Basis: Gamma[n,z]==-((z^n)/(n (e^z)))+(1/n) Gamma[n+1,z]

Rule: If  n∈(SuperMinus[ℤ]), then

∫((Gamma[n,b x])/x)dx  ⟶  -(b/n) ∫((((b x))^(n-1))/(e^(b x)))dx+(1/n) ∫((Gamma[n+1,b x])/x)dx  ⟶  ((Gamma[n,b x])/n)+(1/n) ∫((Gamma[n+1,b x])/x)dx

Program code:

Int[Gamma[n_,b_.*x_]/x_,x_Symbol] :=
  Gamma[n,b*x]/n + 1/n*Int[Gamma[n+1,b*x]/x,x] /;
FreeQ[b,x] && ILtQ[n,0]

2:  ∫((Gamma[n,b x])/x)dx  when  n∉ℤ

Rule: If  n∉ℤ, then

∫((Gamma[n,b x])/x)dx  ⟶  Gamma[n] Log[x]-((((b x))^n)/(n^2))HypergeometricPFQ[{n,n},{1+n,1+n},-b x]

Program code:

Int[Gamma[n_,b_.*x_]/x_,x_Symbol] :=
  Gamma[n]*Log[x] - (b*x)^n/n^2*HypergeometricPFQ[{n,n},{1+n,1+n},-b*x] /;
FreeQ[{b,n},x] && Not[IntegerQ[n]]

2:  ∫(((d x))^m) Gamma[n,b x]dx  when  m≠-1

Derivation: Integration by parts and piecewise constant extraction

Basis: (∂_x)((((d x))^m)/(((b x))^m))==0

Basis: -(1/b)(∂_x)Gamma[m+n+1,b x]==((((b x))^(m+n))/(e^(b x)))

Note: The antiderivative is given directly without recursion so it is expressed entirely in terms of the incomplete gamma function without need for the exponential function.

Rule: If  m≠-1, then

∫(((d x))^m) Gamma[n,b x]dx  ⟶  (((((d x))^(m+1)) Gamma[n,b x])/(d (m+1)))+(1/(m+1)) ∫(((((d x))^m) (((b x))^n))/(e^(b x)))dx                
                                  ⟶  (((((d x))^(m+1)) Gamma[n,b x])/(d (m+1)))+((((d x))^m)/((m+1)(((b x))^m))) ∫((((b x))^(m+n))/(e^(b x)))dx
                                          ⟶  (((((d x))^(m+1)) Gamma[n,b x])/(d (m+1)))-(((((d x))^m) Gamma[m+n+1,b x])/(b (m+1) (((b x))^m)))

Program code:

Int[(d_.*x_)^m_.*Gamma[n_,b_.*x_],x_Symbol] :=
  (d*x)^(m+1)*Gamma[n,b*x]/(d*(m+1)) - 
  (d*x)^m*Gamma[m+n+1,b*x]/(b*(m+1)*(b*x)^m) /;
FreeQ[{b,d,m,n},x] && NeQ[m,-1]

3.  ∫(((c+d x))^m) Gamma[n,a+b x]dx

1:  ∫(((c+d x))^m) Gamma[n,a+b x]dx  when  b c-a d==0

Derivation: Integration by substitution

Rule: If  b c-a d==0, then

∫(((c+d x))^m) Gamma[n,a+b x]dx  ⟶  (1/b) Subst[∫(((((d x)/b)))^m) Gamma[n,x]dx,x,a+b x]

Program code:

Int[(c_+d_.*x_)^m_.*Gamma[n_,a_+b_.*x_],x_Symbol] :=
  1/b*Subst[Int[(d*x/b)^m*Gamma[n,x],x],x,a+b*x] /;
FreeQ[{a,b,c,d,m,n},x] && EqQ[b*c-a*d,0]

2:  ∫((Gamma[n,a+b x])/(c+d x))dx  when  n-1∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: Gamma[n,z]==((z^(n-1))/(e^z))+(n-1) Gamma[n-1,z]

Rule: If  n-1∈(SuperPlus[ℤ]), then

∫((Gamma[n,a+b x])/(c+d x))dx  ⟶  ∫((((a+b x))^(n-1))/((c+d x) (e^(a+b x))))dx+(n-1) ∫((Gamma[n-1,a+b x])/(c+d x))dx

Program code:

Int[Gamma[n_,a_.+b_.*x_]/(c_.+d_.*x_),x_Symbol] :=
  Int[(a+b*x)^(n-1)/((c+d*x)*E^(a+b*x)),x] + (n-1)*Int[Gamma[n-1,a+b*x]/(c+d*x),x] /;
FreeQ[{a,b,c,d},x] && IGtQ[n,1]

3:  ∫(((c+d x))^m) Gamma[n,a+b x]dx  when  (m∈(SuperPlus[ℤ])∨ n∈(SuperPlus[ℤ])∨ (m|n)∈ℤ) ∧ m≠-1

Derivation: Integration by parts

Basis: (∂_x)Gamma[n,a+b x]==-((b (((a+b x))^(n-1)))/(e^(a+b x)))

Rule: If  (m∈(SuperPlus[ℤ])∨ n∈(SuperPlus[ℤ])∨ (m|n)∈ℤ) ∧ m≠-1  , then

∫(((c+d x))^m) Gamma[n,a+b x]dx  ⟶  (((((c+d x))^(m+1)) Gamma[n,a+b x])/(d (m+1)))+(b/(d (m+1)))∫(((((c+d x))^(m+1)) (((a+b x))^(n-1)))/(e^(a+b x)))dx

Program code:

Int[(c_.+d_.*x_)^m_.*Gamma[n_,a_.+b_.*x_],x_Symbol] :=
  Block[{$UseGamma=True},
    (c+d*x)^(m+1)*Gamma[n,a+b*x]/(d*(m+1)) + 
    b/(d*(m+1))*Int[(c+d*x)^(m+1)*(a+b*x)^(n-1)/E^(a+b*x),x]] /;
FreeQ[{a,b,c,d,m,n},x] && (IGtQ[m,0] || IGtQ[n,0] || IntegersQ[m,n]) && NeQ[m,-1]

U:  ∫(((c+d x))^m) Gamma[n,a+b x]dx

Rule:

∫(((c+d x))^m) Gamma[n,a+b x]dx  ⟶  ∫(((c+d x))^m) Gamma[n,a+b x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*Gamma[n_,a_.+b_.*x_],x_Symbol] :=
  Unintegrable[(c+d*x)^m*Gamma[n,a+b*x],x] /;
FreeQ[{a,b,c,d,m,n},x]

2.  ∫u LogGamma[a+b x]dx

1:  ∫LogGamma[a+b x]dx

Derivation: Primitive rule

Basis: ((∂(PolyGamma2[-2, z]))/(∂z))==(LogGamma[z])

Rule:

∫LogGamma[a+b x]dx  ⟶  ((PolyGamma[-2,a+b x])/b)

Program code:

Int[LogGamma[a_.+b_.*x_],x_Symbol] :=
  PolyGamma[-2,a+b*x]/b /;
FreeQ[{a,b},x]

2.  ∫(((c+d x))^m) LogGamma[a+b x]dx

1:  ∫(((c+d x))^m) LogGamma[a+b x]dx  when  m∈(SuperPlus[ℤ])

Derivation: Integration by parts

Rule: If  m∈(SuperPlus[ℤ]), then

∫(((c+d x))^m) LogGamma[a+b x]dx  ⟶  (((((c+d x))^m) PolyGamma[-2,a+b x])/b)-((d m)/b)∫(((c+d x))^(m-1)) PolyGamma[-2,a+b x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*LogGamma[a_.+b_.*x_],x_Symbol] :=
  (c+d*x)^m*PolyGamma[-2,a+b*x]/b -
  d*m/b*Int[(c+d*x)^(m-1)*PolyGamma[-2,a+b*x],x] /;
FreeQ[{a,b,c,d},x] && IGtQ[m,0]

U:  ∫(((c+d x))^m) LogGamma[a+b x]dx

Rule:

∫(((c+d x))^m) LogGamma[a+b x]dx  ⟶  ∫(((c+d x))^m) LogGamma[a+b x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*LogGamma[a_.+b_.*x_],x_Symbol] :=
  Unintegrable[(c+d*x)^m*LogGamma[a+b*x],x] /;
FreeQ[{a,b,c,d,m},x]

3.  ∫u PolyGamma[n,a+b x]dx

1:  ∫PolyGamma[n,a+b x]dx

Derivation: Primitive rule

Basis: ((∂(PolyGamma2[n, z]))/(∂z))==(PolyGamma2[n+1, z])

Rule:

∫PolyGamma[n,a+b x]dx  ⟶  ((PolyGamma[n-1,a+b x])/b)

Program code:

Int[PolyGamma[n_,a_.+b_.*x_],x_Symbol] :=
  PolyGamma[n-1,a+b*x]/b /;
FreeQ[{a,b,n},x]

2.  ∫(((c+d x))^m) PolyGamma[n,a+b x]dx

1:  ∫(((c+d x))^m) PolyGamma[n,a+b x]dx  when  m>0

Derivation: Integration by parts

Rule: If  m>0, then

∫(((c+d x))^m) PolyGamma[n,a+b x]dx  ⟶  (((((c+d x))^m) PolyGamma[n-1,a+b x])/b)-((d m)/b)∫(((c+d x))^(m-1)) PolyGamma[n-1,a+b x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*PolyGamma[n_,a_.+b_.*x_],x_Symbol] :=
  (c+d*x)^m*PolyGamma[n-1,a+b*x]/b - d*m/b*Int[(c+d*x)^(m-1)*PolyGamma[n-1,a+b*x],x] /;
FreeQ[{a,b,c,d,n},x] && GtQ[m,0]

2:  ∫(((c+d x))^m) PolyGamma[n,a+b x]dx  when  m<-1

Derivation: Inverted integration by parts

Rule: If  m<-1, then

∫(((c+d x))^m) PolyGamma[n,a+b x]dx  ⟶  (((((c+d x))^(m+1)) PolyGamma[n,a+b x])/(d (m+1)))-(b/(d (m+1)))∫(((c+d x))^(m+1)) PolyGamma[n+1,a+b x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*PolyGamma[n_,a_.+b_.*x_],x_Symbol] :=
  (c+d*x)^(m+1)*PolyGamma[n,a+b*x]/(d*(m+1)) -
  b/(d*(m+1))*Int[(c+d*x)^(m+1)*PolyGamma[n+1,a+b*x],x] /;
FreeQ[{a,b,c,d,n},x] && LtQ[m,-1]

U:  ∫(((c+d x))^m) PolyGamma[n,a+b x]dx

Rule:

∫(((c+d x))^m) PolyGamma[n,a+b x]dx  ⟶  ∫(((c+d x))^m) PolyGamma[n,a+b x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*PolyGamma[n_,a_.+b_.*x_],x_Symbol] :=
  Unintegrable[(c+d*x)^m*PolyGamma[n,a+b*x],x] /;
FreeQ[{a,b,c,d,m,n},x]

4:  ∫((Gamma[a+b x])^n) PolyGamma[0,a+b x]dx

Derivation: Primitive rule

Basis: ((∂((Gamma[z])^n))/(∂z))=n (PolyGamma2[0, z]) ((Gamma[z])^n)

Rule:

∫((Gamma[a+b x])^n) PolyGamma[0,a+b x]dx  ⟶  (((Gamma[a+b x])^n)/(b n))

Program code:

Int[Gamma[a_.+b_.*x_]^n_.*PolyGamma[0,a_.+b_.*x_],x_Symbol] :=
  Gamma[a+b*x]^n/(b*n) /;
FreeQ[{a,b,n},x]

5:  ∫((((a+b x)!))^n) PolyGamma[0,c+b x]dx  when  c==a+1

Derivation: Primitive rule

Basis: ((∂(((z!))^n))/(∂z))=n (PolyGamma2[0, z+1]) (((z!))^n)

Rule: If  c==a+1, then

∫((((a+b x)!))^n) PolyGamma[0,c+b x]dx  ⟶  (((((a+b x)!))^n)/(b n))

Program code:

Int[((a_.+b_.*x_)!)^n_.*PolyGamma[0,c_.+b_.*x_],x_Symbol] :=
  ((a+b*x)!)^n/(b*n) /;
FreeQ[{a,b,c,n},x] && EqQ[c,a+1]

6.  ∫u Gamma[p,d (a+b Log[c (x^n)])]dx

1:  ∫Gamma[p,d (a+b Log[c (x^n)])]dx

Derivation: Integration by parts

Basis: (∂_x)Gamma[p,d (a+b Log[c (x^n)])]==-((b d n (e^(-a)) (((d (a+b Log[c (x^n)])))^(p-1)))/(x (((c (x^n)))^(b d))))

Rule:

∫Gamma[p,d (a+b Log[c (x^n)])]dx  ⟶  x Gamma[p,d (a+b Log[c (x^n)])]+b d n (e^(-a d)) ∫ ((((d (a+b Log[c (x^n)])))^(p-1))/(((c (x^n)))^(b d)))dx

Program code:

Int[Gamma[p_,d_.*(a_.+b_.*Log[c_.*x_^n_.])],x_Symbol] :=
  x*Gamma[p,d*(a+b*Log[c*x^n])] + b*d*n*E^(-a*d)*Int[(d*(a+b*Log[c*x^n]))^(p-1)/(c*x^n)^(b*d),x] /;
FreeQ[{a,b,c,d,n,p},x]

2:  ∫((Gamma[p,d (a+b Log[c (x^n)])])/x)dx

Derivation: Integration by substitution

Basis: ((F[Log[c (x^n)]])/x)==(1/n) Subst[F[x],x,Log[c (x^n)]] (∂_x)Log[c (x^n)]

Rule:

∫((Gamma[p,d (a+b Log[c (x^n)])])/x)dx  ⟶  (1/n) Subst[Gamma[p,d (a+b x)],x,Log[c (x^n)]]

Program code:

Int[Gamma[p_,d_.*(a_.+b_.*Log[c_.*x_^n_.])]/x_,x_Symbol] :=
  1/n*Subst[Gamma[p,d*(a+b*x)],x,Log[c*x^n]] /;
FreeQ[{a,b,c,d,n,p},x]

3:  ∫(((e x))^m) Gamma[p,d (a+b Log[c (x^n)])]dx  when  m≠-1

Derivation: Integration by parts

Basis: (∂_x)Gamma[p,d (a+b Log[c (x^n)])]==-((b d n (e^(-a d)) (((d (a+b Log[c (x^n)])))^(-1+p)))/(x (((c (x^n)))^(b d))))

Rule: If  m≠-1, then

∫(((e x))^m) Gamma[p,d (a+b Log[c (x^n)])]dx  ⟶  (((((e x))^(m+1)) Gamma[p,d (a+b Log[c (x^n)])])/(e (m+1)))+((b d n (e^(-a d)) (((e x))^(b d n)))/((m+1) (((c (x^n)))^(b d)))) ∫(((e x))^(m-b d n)) (((d (a+b Log[c (x^n)])))^(p-1))dx

Program code:

Int[(e_.*x_)^m_.*Gamma[p_,d_.*(a_.+b_.*Log[c_.*x_^n_.])],x_Symbol] :=
  (e*x)^(m+1)*Gamma[p,d*(a+b*Log[c*x^n])]/(e*(m+1)) + 
  b*d*n*E^(-a*d)*(e*x)^(b*d*n)/((m+1)*(c*x^n)^(b*d))*Int[(e*x)^(m-b*d*n)*(d*(a+b*Log[c*x^n]))^(p-1),x] /;
FreeQ[{a,b,c,d,e,m,n,p},x] && NeQ[m,-1]

7.  ∫u Gamma[p,f (a+b Log[c (((d+e x))^n)])]dx

1:  ∫Gamma[p,f (a+b Log[c (((d+e x))^n)])]dx

Derivation: Integration by substitution

Rule:

∫Gamma[p,f (a+b Log[c (((d+e x))^n)])]dx  ⟶  (1/e) Subst[∫Gamma[p,f (a+b Log[c (x^n)])]dx,x,d+e x]

Program code:

Int[Gamma[p_,f_.*(a_.+b_.*Log[c_.*(d_+e_.*x_)^n_.])],x_Symbol] :=
  1/e*Subst[Int[Gamma[p,f*(a+b*Log[c*x^n])],x],x,d+e*x] /;
FreeQ[{a,b,c,d,e,f,n,p},x]

2:  ∫(((g+h x))^m) Gamma[p,f (a+b Log[c (((d+e x))^n)])]dx  when  e g-d h==0

Derivation: Integration by substitution

Basis: If  e g-d h==0, then (((g+h x))^m) F[d+e x]==(1/e) Subst[(((((g x)/d)))^m) F[x],x,d+e x] (∂_x)(d+e x)

Rule: If  e g-d h==0, then

∫(((g+h x))^m) Gamma[p,f (a+b Log[c (((d+e x))^n)])]dx  ⟶  (1/e) Subst[∫(((((g x)/d)))^m) Gamma[p,f (a+b Log[c (x^n)])]dx,x,d+e x]

Program code:

Int[(g_+h_.x_)^m_.*Gamma[p_,f_.*(a_.+b_.*Log[c_.*(d_+e_.*x_)^n_.])],x_Symbol] :=
  1/e*Subst[Int[(g*x/d)^m*Gamma[p,f*(a+b*Log[c*x^n])],x],x,d+e*x] /;
FreeQ[{a,b,c,d,e,f,g,h,m,n,p},x] && EqQ[e*g-d*h,0]